<?php
/*
 * 学生表格的自动验证和自动填充
 * 作者:Tobey
 * */
class studentModel{
    /*
     * 自动验证
     * */
    public $validate = array(
        /*
         *修改基本信息的时候进行验证  2
         * */
        array("sex",array("男","女"),"性别只有男和女选择!","in",1,2),
        /**
         * 学生注册的时候进行验证  1
         */
        array("stu_number","require","学生的学号必须填写!","regex",1,1),
        array("stu_number",array(4,20),"学生的学号4-20位!","length",1,1),
        array("stu_password_hash","require","学生的密码必须填写!","regex",1,1),
        array("stu_password_hash",array(6,32),"密码最少6位!","length",1,1),
        array("stu_name","require","学生的姓名必须填写!","regex",1,3),
        array("stu_email","email","学生的邮箱格式有误!","regex",1,1),
        array("col_id","number","学校id必须是正整数!","regex",1,1),

        );

    /*
     * 自动填充
     * */
    public $auto = array(
        /*
         * 1表示新增的时候进行自动填充
         * */
        array("sex","fill","男",1),            //性别自动男
        array("stu_password_hash","md5","",1)
        );

}